﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceCS.DesignPattern.Core.StrategyPattern.ShopStrategy
{
    public class CashContext
    {
        private readonly CashBase _strategy;

        public CashContext()
        {
            _strategy = new CashNormal();
        }

        public CashContext(CashBase operation)
        {
            _strategy = operation;
        }
        /// <summary>
        /// 获取实际的价格
        /// </summary>
        /// <param name="sellPrice"></param>
        /// <returns></returns>
        public decimal GetActualPrice(decimal sellPrice)
        {
            return _strategy.AcceptCash(sellPrice);
        }
    }
}
